package com.qingyun.model.video.pojos;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.ibatis.type.Alias;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 文章信息表，存储已发布的文章
 * </p>
 *
 * @author itqingyun
 */

@Data
@TableName("video")
public class Video implements Serializable {




    /**
     * 主键
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 自媒体用户ID
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @TableField("author_id")
    private Long authorId;

    /**
     * 标题
     */
    @TableField("title")
    private String title;

    /**
     * 图文频道ID
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @TableField("channel_id")
    private Long channelId;

    /**
     * 频道名称
     */
    @TableField("channel_name")
    private String channelName;


    /**
     * 标签
     */
    @TableField("labels")
    private String labels;
    /**
     * 点赞数量
     */
    @TableField("likes")
    private Integer likes;
    /**
     * 点赞数量
     */
    @TableField("reply")
    private Integer reply;
    /**
     * 点赞数量
     */
    @TableField("forward")
    private Integer forward;

    /**
     * 创建时间*/
    @TableField(fill = FieldFill.INSERT)
    private Date createdTime;



    /**
     * 当前状态
     0 草稿
     1 提交（待审核）
     2 审核失败
     3 人工审核
     4 人工审核通过
     8 审核通过（待发布）
     9 已发布
     */
    @TableField("status")
    private Short status;

    /**
     * 定时发布时间，不定时则为空*/
    @TableField("publish_time")
    private Date publishTime;

    /**
     * 拒绝理由
     */
    @TableField("reason")
    private String reason;

   /* *
     * 发布库文章ID
    @TableField("video_id")
    private Long videoId;
*/

    /**
     * 上架状态：1为上架0为下架
     */
    @TableField("enable")
    private Short enable;

    /**
     *内容
     */
    private String content;

    @TableField(exist = false)
    private Boolean isLike;

    @TableField(exist = false)
    private String authorName;
    @TableField(exist = false)
    private String authorImage;
    public enum Status{
        NORMAL((short)0),SUBMIT((short)1),FAIL((short)2),ADMIN_AUTH((short)3),ADMIN_SUCCESS((short)4),SUCCESS((short)8),PUBLISHED((short)9);
        short code;
        Status(short code){
            this.code = code;
        }
        public short getCode(){
            return this.code;
        }
    }






}
